<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>pattern属性</title>
</head>
<body>
<form action="#" method="get">
    账 &nbsp;&nbsp;&nbsp;&nbsp;号；<input type="text" name="username" pattern="^[a-zA-z][a-zA-Z0-9_][4,15]$">(以字母开头，长度在6~18字节，允许字母、数字、下划线)<br>
    密 &nbsp;&nbsp;&nbsp;&nbsp;码：<input type="password" name="pwd" pattern="^[a-zA-z]\w{5,17}$">(以字母开头，长度在6~18字节，只能包含字母、数字和下划线)<br>
    身份证号：<input type="text" name="mycard" pattern="^d{15}\d{18}$">(15位、18位数字)<br>
    Email地址：<input type="email" name="myemail" pattern="^w+(-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"/>
    <input type="submit" value="提交">
</form>
</body>
</html>